package com.itheima.example;

import java.io.FileOutputStream;
import java.io.IOException;

public class Example02 {
    public static void main(String[] args) throws Exception {
        FileOutputStream output = null;
        try {
            output = new FileOutputStream("test.txt");
            String s = "www.itheima.com";
            byte[] arr = s.getBytes();
            for (int i = 0; i < arr.length; i++) {
                output.write(arr[i]);
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            output.close();
        }

    }
}
